<%@page isELIgnored="false" import="java.net.*" %>
<%@taglib prefix="tiles" uri="struts-tiles" %>
<%@taglib prefix="html" uri="struts-html" %>
<%@taglib prefix="bean" uri="struts-bean" %>
<%@taglib prefix="c" uri="jstl" %>
<%@taglib prefix="mcfn" uri="mcfn" %>
<%@taglib prefix="fn" uri="jstl-fn" %>

<%@page import="com.mastercard.assets.web.util.to.UserLogin"%><c:set var="Formas" value="${Formas}" />
<c:set var="Flujos" value="${Flujos}" />
<c:set var="Alertas" value="${Alertas}" />
<c:set var="FormasLength" value="${fn:length(Formas)}" />
<c:set var="FlujosLength" value="${fn:length(Flujos)}" />
<c:set var="AlertasLength" value="${fn:length(Alertas)}" />
				<div id="bodyContent">
						<h1>Flows</h1>






						
						
						<br/>
						<html:form action="/FlujosF" method="post" styleId="FlujosFForm">
						<html:hidden property="cveFlujo" styleId="cveFlujo"  />
						<html:hidden property="operation" styleId="operationAl1" />
						<html:hidden property="page" value="1" />
						</html:form>
						<h2>Flows</h2>
						<table style="border: 0px solid red ; width: 100%;" border="0" >
							<tr>
								<td colspan="3" align="right">
									<html:image src="images/btnAddFlujos.gif" onclick="document.getElementById('operationAl1').value=1;document.getElementById('FlujosFForm').submit( );" />
								</td>
							</tr>
						</table>
						<table class="tabDatos">
<c:choose>
<c:when test="${FlujosLength gt 0}">
							<thead>
								<tr>
									<th>Name</th>
									<th>Description</th>
									<th>Flow type</th>
									<th># Tasks</th>
									<th></th>
								</tr>
							</thead>
<c:forEach items="${Flujos}" var="flow" varStatus="flowStatus">
<c:set var="Tipo" value=""/>
<c:if test="${flow.tipo eq 1}"><c:set var="Tipo" ><bean:message key="com.mastercard.assets.web.modules.flujosf.add.labels.Tipo.1.1"/></c:set></c:if>
<c:if test="${flow.tipo eq 2}"><c:set var="Tipo" ><bean:message key="com.mastercard.assets.web.modules.flujosf.add.labels.Tipo.2.1"/></c:set></c:if>
<c:if test="${flow.tipo eq 3}"><c:set var="Tipo" ><bean:message key="com.mastercard.assets.web.modules.flujosf.add.labels.Tipo.3.1"/></c:set></c:if>
<c:if test="${flow.tipo eq 4}"><c:set var="Tipo" ><bean:message key="com.mastercard.assets.web.modules.flujosf.add.labels.Tipo.4.1"/></c:set></c:if>
							<tr>
								<td title="${flow.nombre}">${mcfn:getShortString(flow.nombre,25)}</td>
								<td title="${flow.descripcion}">${mcfn:getShortString(flow.descripcion,150)}</td>
								<td title="${Tipo}">${mcfn:getShortString(Tipo,80)}</td>
<c:set var="NumTareas" value="0" /><c:forEach items="${flow.tblTareas}" var="tarea"><c:if test="${tarea.status ne 0}"><c:set var="NumTareas" value="${NumTareas + 1}" /></c:if></c:forEach>
								<td>${NumTareas}</td>
								<td align="rigth">
									<html:image src="images/btnEliminar.gif" onclick="document.getElementById('operationAl1').value=2;document.getElementById('cveFlujo').value=${flow.cveFlujo};document.getElementById('FlujosFForm').submit( );" />
									 &nbsp; 
									<html:image src="images/btnEdit.gif" onclick="document.getElementById('operationAl1').value=3;document.getElementById('cveFlujo').value=${flow.cveFlujo};document.getElementById('FlujosFForm').submit( );" />
									 &nbsp; 
									<html:image src="images/btnTareas.gif" onclick="document.getElementById('operationAl1').value=4;document.getElementById('cveFlujo').value=${flow.cveFlujo};document.getElementById('FlujosFForm').submit( );" />
								</td>
							</tr>
</c:forEach>
</c:when>
<c:otherwise>
							<tr>
								<td colspan="3">
									There are no alerts to list
								</td>
							</tr>
</c:otherwise>
</c:choose>
						</table>
						









						
						
						<br/>
						<html:form action="/Alertas" method="post" styleId="AlertasForm">
						<html:hidden property="cveAlerta" styleId="cveAlerta"  />
						<html:hidden property="operation" styleId="operationAl" />
						<html:hidden property="page" value="1" />
						</html:form>
						<h2>Alerts</h2>
						<table style="border: 0px solid red ; width: 100%;" border="0" >
							<tr>
								<td colspan="3" align="right">
									<html:image src="images/btnAddAlertas.gif" onclick="document.getElementById('operationAl').value=1;document.getElementById('AlertasForm').submit( );" />
								</td>
							</tr>
						</table>
						<table class="tabDatos">
<c:choose>
<c:when test="${AlertasLength gt 0}">
							<thead>
								<tr>
									<th>Name</th>
									<th>Description</th>
									<th></th>
								</tr>
							</thead>
<c:forEach items="${Alertas}" var="alert" varStatus="alertStatus">
							<tr>
								<td title="${alert.nombre}">${mcfn:getShortString(alert.nombre,25)}</td>
								<td title="${alert.descripcion}">${mcfn:getShortString(alert.descripcion,150)}</td>
								<td width="7%" align="rigth">
									<html:image src="images/btnEliminar.gif" onclick="document.getElementById('operationAl').value=2;document.getElementById('cveAlerta').value=${alert.cveAlerta};document.getElementById('AlertasForm').submit( );" />
									 &nbsp; 
									<html:image src="images/btnEdit.gif" onclick="document.getElementById('operationAl').value=3;document.getElementById('cveAlerta').value=${alert.cveAlerta};document.getElementById('AlertasForm').submit( );" />
								</td>
							</tr>
</c:forEach>
</c:when>
<c:otherwise>
							<tr>
								<td colspan="3">
									There are no alerts to list
								</td>
							</tr>
</c:otherwise>
</c:choose>
						</table>
						
						<br/>
						<html:form action="/Formas" method="post" styleId="FormasForm">
						<html:hidden property="cveForma" styleId="cveForma"  />
						<html:hidden property="operacion" styleId="operacion" />
						<html:hidden property="page" value="1" />
						</html:form>
						<h2>Forms</h2>
						<table style="border: 0px solid red ; width: 100%;" border="0" >
							<tr>
								<td colspan="3" align="right">
									<html:image src="images/btnAddFormas.gif" onclick="document.getElementById('operacion').value=1;document.getElementById('FormasForm').submit( );" />
								</td>
							</tr>
						</table>
						<table class="tabDatos">
<c:choose>
<c:when test="${FormasLength gt 0}">
							<thead>
								<tr>
									<th>Name</th>
									<th>Description</th>
									<th># Exits</th>
									<th></th>
								</tr>
							</thead>
<c:forEach items="${Formas}" var="form" varStatus="formStatus">
<c:set var="NoSalidas" value="0" />
<c:forEach items="${form.tblFormaSalidas}" var="formSal">
<c:if test="${formSal.status eq 1}">
<c:set var="NoSalidas" value="${NoSalidas + 1}" />
</c:if>
</c:forEach>
							<tr>
								<td title="${form.nombre}">${mcfn:getShortString(form.nombre,40)}</td>
								<td title="${form.descripcion}">${mcfn:getShortString(form.descripcion,100)}</td>
								<td align="center">${NoSalidas}</td>
								<td align="rigth">
									<html:image src="images/btnEliminar.gif" onclick="document.getElementById('operacion').value=2;document.getElementById('cveForma').value=${form.cveForma};document.getElementById('FormasForm').submit( );" />
									 &nbsp; 
									<html:image src="images/btnEdit.gif" onclick="document.getElementById('operacion').value=3;document.getElementById('cveForma').value=${form.cveForma};document.getElementById('FormasForm').submit( );" />
								</td>
							</tr>
</c:forEach>
</c:when>
<c:otherwise>
							<tr>
								<td colspan="3">
									<bean:message key="com.mastercard.assets.web.modules.forms.index.messages.NoFormsExist"/>
								</td>
							</tr>
</c:otherwise>
</c:choose>
						</table>
					</div>
					<div id="footContent"></div>
<%
UserLogin user = ( UserLogin ) session.getAttribute( "UserLogin" ) ;
user.clearMessageError( ) ;
%>
